import java.util.ArrayList;


public class Node {
    ArrayList<Node> children = new ArrayList<Node>();
    ArrayList<Attribute> attributes = new ArrayList<Attribute>();

    String meta = null;

    public ArrayList<Node> getChildren() {
        return children;
    }

    public ArrayList<Attribute> getAttributes() {
        return attributes;
    }

    String content = null;
    String type = null;
    boolean inline;

    public void setMeta(String meta) {
        this.meta = meta;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setInline(boolean inline) {
        this.inline = inline;
    }


    public String getMeta() {
        return meta;
    }

    public String getContent() {
        return content;
    }

    public String getType() {
        return type;
    }

    public boolean isInline() {
        return inline;
    }

    public void addChild(Node child) {
        this.children.add(child);
    }

    public String toString() {
        String child = "";
        for (Node c: children) {
            child = child + "\n" + c.toString();
        }
        return "Node:" + type + "\n[ " + child + " ]";
    }

    public void addAttribute(Attribute at) {
        if (at != null)
        this.attributes.add(at);
    }

    public void addAttributes(ArrayList<Attribute> list) {
        for (Attribute at: list) {
            this.attributes.add(at);
        }
    }
}
